import {get,post} from "./axios.js"

export function login(data){
	post("/user/login",data)
	.then(res=>{
		return res.data
	})
}

export function getUserId(){
	return	post("/user/getUserId");
}
export function getRoleIdByUserId(data){
  return post("/userRole/getRoleIdByUserId",data)
}
export function getResourceList(data){
	return post("/roleResource/getResourceList",data)
}
export function getMenu(data){
	return post("/resource/getMenu",data)
}
export function getUserList(data){
	return post("/user/getUserList",data)
}
export function addUser(data){
	return post("/user/addUser",data)
}
export function delUserList(data){
	return post("/user/delUserList",data)
}
export function getResourceCascader(){
	return get("/resource/getResourceCascader")
}
export function addResource(data){
	return post("/resource/addResource",data)
}
export function getResource(){
	return get("/resource/getResource")
}
export function delResource(data){
	return post("/resource/delResource",data)
}
export function updateResource(data){
	return post("/resource/updateResource",data)
}
export function getRoleList(data){
	return post("/role/getRoleList",data)
}
export function addRole(data){
	return post("/role/addRole",data)
}
export function delRole(data){
	return post("/role/delRole",data)
}
export function updateRole(data){
	return post("/role/updateRole",data)
}

export function getUserRolePages(data){
	return post("/userRole/pageList",data)
}
export function getUserByIdList(data){
	return post("/user/getUserByIds",data)
}
export function getRoleByIdList(data){
	return post("/role/getRoleByIds",data)
}
export function updateUserRole(data){
	return post("/userRole/updateRole",data)
}

export function getResourceListByRoleId(data){
	return post("/roleResource/getResource",data)
}

export function addUserRole(data){
	return post("/userRole/add",data)
}
export function getUserIdByUserName(data){
	return post("/user/getUserIdByUserName",data)
}
export function delByUserIds(data){
	return post("/userRole/delByUserIds",data)
}
export function updateByRoleId(data){
	return post("/userRole/updateByRoleId",data)
}

export function getRoles(){
	return get("/role/getRoles")
}
export function assignResources(data){
	return post("/roleResource/assignResources",data)
}

